package D2;

import java.time.LocalDate;
import java.time.LocalTime;

public class Java07 {
    public static void main(String[] args) {
        //LocalTime类的基本使用
        //0、获取本地时间对象
        LocalTime it = LocalTime.now();
        System.out.println(it);
        //1、获取时间中的信息
        int hour = it.getHour();
        System.out.println(hour);
        int min = it.getMinute();
        System.out.println(min);
        int s = it.getSecond();
        System.out.println(s);
        //2、修改时间
        LocalTime it3 = it.withHour(8);
        LocalTime it4 = it.withMinute(10);
        LocalTime it5 = it.withSecond(10);
        LocalTime it6 = it.withNano(100);
        System.out.println(it6);
        //3、加多少
        LocalTime it7 = it.plusHours(10);
        LocalTime it8 = it.plusMinutes(1000);
        LocalTime it9 = it.plusSeconds(10);
        LocalTime it10 = it.plusNanos(1000000);
        System.out.println(it10);
        //4、减多少
        LocalTime it11 = it.minusHours(10);
        LocalTime it12 = it.minusMinutes(10);
        LocalTime it13 = it.minusSeconds(10);
        LocalTime it14 = it.minusNanos(100000000);
        System.out.println(it14);
        //5、获取指定时间的对象
        LocalTime it15 = LocalTime.of(12,12,12);
        LocalTime it16 = LocalTime.of(12,12,12);
        System.out.println(it16);
        //6、判断两个时间对象，是否相等，在前还是在后
        System.out.println(it15.equals(it14));
        System.out.println(it15.isAfter(it12));
        System.out.println(it15.isBefore(it11));
    }
}
